package com.neu.flashmall.ms.vo;

import com.neu.common.utils.ListCloneUtil;
import com.neu.flashmall.ms.entity.SysMenu;
import lombok.Data;
import lombok.SneakyThrows;

import java.util.List;


@Data
public class SysMenuItemVo implements Cloneable{
    private SysMenu detail;
    private Long id;
    private String name;

    //该用户是否拥有该权限，true代表有，false代表没有
    private Boolean has = false;
    private List<SysMenuItemVo> children;

    @SneakyThrows
    @Override
    public Object clone() throws CloneNotSupportedException {
        SysMenuItemVo cloneOne = (SysMenuItemVo) super.clone();
        SysMenu newOne = (SysMenu) this.detail.clone();
        cloneOne.setDetail(newOne);
        cloneOne.setChildren(ListCloneUtil.clone(this.children,SysMenuItemVo.class));
        return cloneOne;
    }
}
